<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

</body>
<script>
	//  原型链+借用构造函数的组合继承
	const Box = function(){
		this.userName = "lisi";
	};
	Box.prototype.fn = function(){
		console.log(this.userName);
	}
	const Desk = function(){
		Box.call(this);
	}
	Desk.prototype = Box.prototype;
	Desk.prototype.a = 1;
	Desk.prototype.constructor = Desk;
	const obj = new Desk();
	console.log(obj.userName);
	console.log(obj.fn);
	obj.fn();
	console.log(obj);
</script>
</html>